package com.jiliason.segmentation.entity.datastructures;

import com.google.common.collect.Lists;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

@Getter
public class PolyTree<T> {

    @Setter
    private T data;

    private final List<PolyTree<T>> children;

    public PolyTree(T data) {
        this.data = data;
        this.children = Lists.newArrayList();
    }

    public void addChild(PolyTree<T> child) {
        this.children.add(child);
    }

}
